<?php
/**
 * 后台用户管理模型
 */

namespace App\Model;


use EasySwoole\Mysqli\QueryBuilder;
use EasySwoole\ORM\AbstractModel;

class Adm extends  AbstractModel
{
    protected $tableName = 'adm';
    protected $autoTimeStamp = false;

    public function grp(){
        return $this->hasOne(AdmGroup::class,null,'group_id','id');
    }

    protected function setPasswordAttr( $v) : string {
        return password_hash($v,PASSWORD_DEFAULT);
    }
}